package com.blogSystem.user.dao;

import com.blogSystem.user.pojo.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface UserDao extends JpaRepository<User,String> , JpaSpecificationExecutor <User>{
    public User findByUsernameAndRole(String username,String role);
    public User findByMobile(String mobile);
    public void deleteUserByIdIn(List<String> ids);
    public Page<User> findAllByRole(String role, Pageable pageable);
    public Page<User> findAllByUsernameLikeAndRole(String username,String role,Pageable pageable);
    public User findByUsername(String username);
    public Page<User> findByIdIn(List<String> ids,Pageable pageable);
}
